package com.atguigu.condition;

import org.springframework.context.annotation.ImportSelector;
import org.springframework.core.type.AnnotationMetadata;

/**自定义返回需要导入的组件
 * @author Honglixi
 * @create 2021-03-26 17:18
 */
public class MyImportSelector implements ImportSelector {
    /**
     *
     * @param annotationMetadata 当前标注@Import注解的类的所有注解信息
     * @return 导入到容器中的组件全类名
     */
    @Override
    public String[] selectImports(AnnotationMetadata annotationMetadata) {
//        annotationMetadata.
        return new String[]{"com.atguigu.bean.Yellow","com.atguigu.bean.Red"};
    }
}
